# models/__init__.py
from .engine import db
from .base import Base

# Import model classes to ensure they are all known to SQLAlchemy's metadata
from .account import Account
from .model import App, Tag, TagBinding, UploadFile
from .dataset import (
    Dataset,
    DatasetPermissionEnum,
    DatasetProcessRule,
    Document,
    DocumentSegment,
    Embedding,
    DatasetKeywordTable,
    AppDatasetJoin,
    DatasetMetadata,
    ChildChunk
)

# List all imported models to make them available via "from models import X"
__all__ = [
    "db",
    "Base",
    "Account",
    "App",
    "Tag",
    "TagBinding",
    "UploadFile",
    "Dataset",
    "DatasetPermissionEnum",
    "DatasetProcessRule",
    "Document",
    "DocumentSegment",
    "Embedding",
    "DatasetKeywordTable",
    "AppDatasetJoin",
    "DatasetMetadata",
    "ChildChunk",
]

